package com.quanshu.exchange.ui.gui.login;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.widget.TextView;

import com.quanshu.exchange.R;
import com.quanshu.exchange.support.utils.RxViewHelper;
import com.quanshu.exchange.ui.base.BaseDialog;

import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.subjects.BehaviorSubject;

/**
 * Created by jye on 2018/1/25.
 */
public class DialogUpdateVersion extends BaseDialog {

    @BindView(R.id.content)
    TextView content;
    @BindView(R.id.ok_btn)
    TextView okBtn;

    private BehaviorSubject okBtnClick = BehaviorSubject.create();

    public DialogUpdateVersion(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_version_update_layout);
        ButterKnife.bind(this);
        initListener();
    }

    private void initListener() {

        RxViewHelper.getInstance().clicks(okBtn, aVoid -> okBtnClick.onNext(aVoid));
    }

    public void setContent(String str, TextView.BufferType bufferType) {
        content.setText(str, bufferType);
    }

    public BehaviorSubject getOkBtnClick() {
        return okBtnClick;
    }
}
